Computational Photography Project 2

1 Fun with filters

Gradient Magnitude Computation

Gradient magnitudes involve observing changes in pixel brightnesses over an image horizontally and vertically, but since images are discrete we must discretize this derivative. This involves convolving images with the [-1, 1] vector (horizontally and vertically for x and y).

We can then square our values (avoiding negative and positives) and add the add the x and y components to see where the large gradients are, these correspond to the edges. In practice edges can be quite noisy due to the discrete nature of camers, so filtering is often done, and we can convolve the [-1,1] vector with our filter before to save computation.

1.1 Finite difference operator

1.2 Derivative of Gaussian filter

The differences between this image and the prior one (1.1) is that there is a lot of noise in many of the edges, we can especially see this in the jigsaw pattern on the camera, and the jagged edges on the tripod. The gaussian filter really smooths out the edges removing noise.

1.3

The famed leaning tower of pisa is clearly a failure case because it's default orientation is crooked. All the lines in the tower offset the other straight edges in the picture, so this method rotates it by so much when it could have just rotated by 1 degree.

2 Fun with frequencies

2.1

Notice how the lines in the boulders above me are now very pronounced and not blurry, also the boulders up in the snow appear to become a bit sharper along with the lines of the snow itself. You can also notice the edges defining me and my backpack become much crisper. This was taken with an old iPhone long ago so the picture was quite blurry.

Blurring a sharp image, then restoring it.

2.2 Hybrid Images

Anthony & Coca

This worked wonderfully because we can see the original images are already mostly low or high frequency so they mesh really well and complement one another.

Oak trees

Pikachu & Charmander

I would consider this a failure case because since charmander and pikachu are cartoon characters, the blurring effect in pikachu's body isn't that pronounced and it causes us to see charmander pretty well at distance, while seeing a solid filled in pikachu with very blurry lines outside.

It seems cartoons and animation with a multitude of solid colors encompassed by edges aren't well suited to this topic.

2.3 Gaussian & Laplacian Stacks

Lincoln in Dalivision & Anthony+Coca decomposed

2.4 Multiresolution Blending

Oraple

Double goats

Nightmare candidate

Final thoughts

The coolest thing I learned is truly how versatile the Gaussian filter is as it can act as a lowpass and highpass filter depending on whether we are applying it or subtracting it's result. It's cool how we can combine these two use cases into generating images that look completely different at different distances!